﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Customers.master" AutoEventWireup="true" CodeFile="ChiTietSanPham.aspx.cs" Inherits="ChiTietSanPham" %>


<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div class="CTSP">
    <table >
    <asp:DataList ID="DataList1" runat="server" DataSourceID="AccessDataSource1"  DataKeyField="MaSP" OnItemCommand="ThemGioHang">
        <ItemTemplate>
            <tr>
            <td valign="top" class="CTSP-td">
                <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/images/cart.png"  Width="100px" CssClass="imgGioHang" /><br />
                <asp:Image ID="Image1" runat="server" Height="190px" 
                ImageUrl='<%# Eval("Hinh", "{0}") %>' Width="190px" />
                <asp:Label ID="MaSPLabel" runat="server" Text='<%# Eval("MaSP") %>' CssClass="maSP" />
                <br />
                <asp:Label ID="TenSPLabel" runat="server" Text='<%# Eval("TenSP") %>' />
                <asp:ImageButton ID="ImageButton2" runat="server" ImageUrl="~/images/Like.png" Height="25px" Width="25px" OnClick="ImageButton2_Click" />
                <br />
                <asp:Label ID="HangSXLabel" runat="server" Text='<%# Eval("HangSX") %>' Font-Bold="true" ForeColor="Black" />
                <br />
                <asp:Label ID="TinhTrangLabel" runat="server" Text='<%# Eval("TinhTrang") %>' Font-Bold="false" ForeColor="Gray"/>
                <br />
                <asp:Label ID="GiaLabel" runat="server" Text='<%# Eval("Gia") %>' Font-Bold="true" ForeColor="Red"/> <font color="red">&nbsp VND</font>
                <br />
                <br />
                <img src="images/Like.png" height="15px" width="15px" style="vertical-align:bottom" />
                <asp:Label ID="LikeLabel" runat="server" Text='<%# Eval("LikeSanPham") %>' Font-Bold="false"/>&nbsp&nbsp&nbsp
                <img src="images/Viewers.png" height="15px" width="15px" style="vertical-align:bottom" />
                <asp:Label ID="Xem" runat="server" Text='<%# Eval("XemSanPham") %>' Font-Bold="false"/>
                <br />             
                <a href="ChiTietSanPham.aspx?TenSP=<%#Eval("TensP") %>"><asp:Label ID="ThongBaoLike" runat="server" Text=" "></asp:Label></a>
                <br />
                
            </td>
            <td class="CTSP-detail">
                <asp:Image ID="Image2" runat="server" Height="400px" 
                ImageUrl='<%# Eval("HinhAnh", "{0}") %>' Width="600px" />
                <br />               
                <asp:Label ID="ChiTietLabel" runat="server" Text='<%# Eval("ChiTiet") %>' />
                <br /> 
                <h2>Bình Luận:</h2>
                <div class="comment">
                <asp:DataList ID="DataList2" runat="server" DataSourceID="AccessDataSource2">
                
                    <ItemTemplate>
                    
                        <li>Người Đăng:</li>
                        <asp:Label Text='<%# Eval("ID") %>' runat="server" ID="TENKHLabel" /><br />
                        <li>Ngày Đăng:</li>
                        <asp:Label Text='<%# Eval("NgayDang") %>' runat="server" ID="NgayDangLabel" /><br />
                        <li>Nội Dung:</li>
                        <br><asp:Label Text='<%# Eval("NOIDUNG") %>' runat="server" ID="NOIDUNGLabel"/><br /></br>
                        <br />
                    
                    </ItemTemplate>
                    
                </asp:DataList>
                </div>
                <asp:AccessDataSource runat="server" ID="AccessDataSource2" DataFile="~/App_Data/Data.mdb" SelectCommand="SELECT NOIDUNG,ID, NgayDang FROM Commnent WHERE (MaSP = ?)">
                    <SelectParameters>
                        <asp:ControlParameter ControlID="MaSPLabel" PropertyName="Text" Name="MaSP" Type="String"></asp:ControlParameter>
                    </SelectParameters>
                </asp:AccessDataSource>
                <asp:TextBox ID="Coment" runat="server" TextMode="MultiLine" Height="50px" Width="500px" ></asp:TextBox>
                 <asp:Button ID="CMGui" runat="server" Text="Gửi" OnClick="CMGui_Click" CssClass="myButton" />
                <asp:Label ID="Xacnhan" runat="server" Text=""></asp:Label>               
            </td>
            </tr>        
            
        </ItemTemplate>


    </asp:DataList>
        <asp:AccessDataSource ID="AccessDataSource1" runat="server"
            DataFile="~/App_Data/Data.mdb"
            SelectCommand="SELECT MaSP, TenSP, HangSX, TinhTrang, ChiTiet, Gia, Hinh, HinhAnh, LikeSanPham, XemSanPham FROM SanPham WHERE (TenSP = ?)">
        <SelectParameters>
            <asp:QueryStringParameter Name="TenSP" QueryStringField="TenSP" Type="String" />
        </SelectParameters>
    </asp:AccessDataSource>
    </table>
    </div>
</asp:Content>

